package cmd

import (
	"fmt"
	"github.com/spf13/cobra"
	"svs/service"
	"svs/service/algorithm"
)

var Algorithm = &cobra.Command{
	Use:     "algorithm",
	Short:   "",
	GroupID: "",
	Long:    "",
}

type AL struct {
	service.Algorithm
}

func init() {
	fmt.Println("algorithm init")
	al := AL{}
	al.Algorithm = algorithm.NewSm2()

	Algorithm.Run = func(cmd *cobra.Command, args []string) {
		switch args[0] {
		case "ec": //export cert
			al.ExportCert(args[1])
		}
	}

}
